home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
001-100
/
001-025
/
004
/
bm
/
mkdescvec.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-17
|
694b
|
33 lines
#include "bm.h"
#ifdef BSD
#include <strings.h>
#else
#define index strchr
#include <string.h>
#endif
/* scan a newline-separated string of patterns and set up the
* vector of descriptors, one pattern descriptor per pattern.
* Return the number of patterns */
int
MkDescVec(DescVec, Pats)
struct PattDesc *DescVec[];
char *Pats;
{
int NPats = 0;
char *EndPat;
extern struct PattDesc *MakeDesc();
while (*Pats && (EndPat = index(Pats,'\n')) && NPats < MAXPATS) {
*EndPat = '\0';
DescVec[NPats] = MakeDesc(Pats);
Pats = EndPat + 1;
++NPats;
} /* while */
if (*Pats && NPats < MAXPATS) {
DescVec[NPats] = MakeDesc(Pats);
++NPats;
} /* if */
return(NPats);
} /* MkDescVec */